<template>
  <div class="home">
    <el-container>
      <!-- 头部 -->
      <el-header>
        <div class="header_title">
          <img src="~assets/img/home.jpg" alt />
          <div>Background management system</div>
        </div>
        <el-button class="logout" type="info" @click="Logout">Logout</el-button>
      </el-header>

      <el-container>
        <!-- 侧边 -->
        <el-aside >
          <leftaside></leftaside> 
        </el-aside>

        <!-- 主体 -->
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import leftaside from 'views/home/child/aside.vue'

export default {
  name: "home",
  components: {
    leftaside
  },
  methods: {
    Logout() {
      sessionStorage.clear();
      this.$router.replace("/login");
    },
  },
};
</script>

<style lang="less" scoped>
.home {
  height: 100%;
  .el-container {
    height: 100%;
    .el-header {
      display: flex;
      justify-content: space-between;
      align-items: center;

      margin: 0;
      padding: 0;

      background-color: #373c41;
      color: #fff;
      line-height: 60px;

      .header_title {
        display: flex;
        height: 100%;
        img {
          position: relative;
          top: 50%;
          left: 5px;
          transform: translate(0, -50%);

          height: 80%;
          border-radius: 50%;

          box-shadow: 0 0 5px #000;
        }
        div {
          margin-left: 15px;
          color: #000;
          font-weight: bold;
          text-shadow: 0 0 5px #fff;
        }
      }
      
      .logout {
        background-color: #373c41;
        border: none;
        font-weight: bolder;

        &:hover {
          color: #ace;
        }
      }
    }

    .el-aside {
      background-color: #323744;
      color: #fff;
      width: auto !important;
    }

    .el-main {
      background-color: #e9eef3;
      color: #333;
      text-align: center;
    }
  }
}
</style>